package simple;


public class Page {

	private String title;
	private String text;
	
	public Page() {
		title = "";
		text = "";
	}
	
	void addText(String text) {
		if ( text != null )
			this.text += text;
	}
	
	void removeText() {
		this.text = "";
	}
	
	String getPageContents() {
		return this.title + "\n" + this.text;
	}
	
	boolean searchWord(String word) {
		if( text.indexOf(word) >= 0 )
			return true;
		return false;
	}
	boolean containsDigits(){
		for(int i = 0; i <= 9 ; i++) {
			if( text.indexOf(i) >= 0 ) 
				return true;
		}
		return false;
	}
}